package academic.concordia.bankofquebec.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

@Entity
public class Account implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String accountNumber;
	private double balance;
	private Date openingDate;
//	@ManyToOne
//	@JoinColumn(name="client")
	private Client client;
//	@OneToOne(mappedBy="accountType")
	private AccountType accountType;
//	@OneToMany(mappedBy="transaction")
	private List<Transaction> transactions;
//	@OneToOne(mappedBy="creditCard")
	private CreditCard creditCard;
//	@OneToOne(mappedBy="savingsAccount")
	private SavingsAccount savingsAccount;
//	@OneToOne(mappedBy="checkingsAccount")
	private CheckingsAccount checkingsAccount;
//	@OneToOne(mappedBy="gIC")
	private GIC gic;
//	@OneToOne(mappedBy="mutualFunds")
	private MutualFunds mutualFunds;
	
	public Account() {
		super();
		// TODO Auto-generated constructor stub
	}
	@Id
	public String getAccountNumber() {
		return accountNumber;
	}
	public void setAccountNumber(String accountNumber) {
		this.accountNumber = accountNumber;
	}
	public double getBalance() {
		return balance;
	}
	public void setBalance(double balance) {
		this.balance = balance;
	}
	public Date getOpeningDate() {
		return openingDate;
	}
	public void setOpeningDate(Date openingDate) {
		this.openingDate = openingDate;
	}
	@OneToOne
	public AccountType getAccountType() {
		return accountType;
	}
	public void setAccountType(AccountType accountType) {
		this.accountType = accountType;
	}
	@OneToMany
	public List<Transaction> getTransactions() {
		return transactions;
	}
	public void setTransactions(List<Transaction> transactions) {
		this.transactions = transactions;
	}
	@OneToOne
	public CreditCard getCreditCard() {
		return creditCard;
	}
	public void setCreditCard(CreditCard creditCard) {
		this.creditCard = creditCard;
	}
	@OneToOne
	public SavingsAccount getSavingsAccount() {
		return savingsAccount;
	}
	public void setSavingsAccount(SavingsAccount savingsAccount) {
		this.savingsAccount = savingsAccount;
	}
	@OneToOne
	public CheckingsAccount getCheckingsAccount() {
		return checkingsAccount;
	}
	public void setCheckingsAccount(CheckingsAccount checkingsAccount) {
		this.checkingsAccount = checkingsAccount;
	}
	@OneToOne
	public GIC getGic() {
		return gic;
	}
	public void setGic(GIC gic) {
		this.gic = gic;
	}
	@OneToOne
	public MutualFunds getMutualFunds() {
		return mutualFunds;
	}
	public void setMutualFunds(MutualFunds mutualFunds) {
		this.mutualFunds = mutualFunds;
	}
	@ManyToOne
	@JoinColumn(name="client")
	public Client getClient() {
		return client;
	}
	public void setClient(Client client) {
		this.client = client;
	}
}
